<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('变更记录')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 select-table table-striped">
                 <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
    var prefix = ctx + "conpermit/reviewrecord";
    var enterPriseprefix = ctx + "enterprise/enterprise";
    
    $(function() {
    	var guid = [[${guid}]]
    	 var options = {
      			showSearch:false,
               	showRefresh:false,
               	showToggle:false,
               	showColumns:false,
    			url: prefix + "/changeTableInfo/"+guid,
                updateUrl: prefix + "/edit/{id}",
                exportUrl: prefix + "/export",
                detailUrl: prefix + "/changeExamineDetail/{id}",
                detailThreeUrl: enterPriseprefix + "/bulidUnitDetail/{id}",
                detailFiveUrl: enterPriseprefix + "/detail/{id}",
                modalName: "变更记录",
                columns: [{
                        field: 'id',
                        title: '序号',
						formatter: function (value, row, index) {
						
						    return index + 1;
						}
                    },
					{
                        field: 'guid',
                        title: '变更记录标识符',
						visible: false
                    },
					{
                        field: 'unitEngineeringName',
                        title: '工程名称'
                    },
					{
                        field: 'constructUnitId',
                        title: '建设单位标识符',
						visible: false
	                },
                    {
                        field: 'constructUnit',
                        title: '建设单位',
						formatter: function (value, row, index) {
							var actions = [];
							if(!$.common.isEmpty(row.constructUnitId) && !$.common.isEmpty(value)){
								actions.push('<a href="javascript:void(0)" onclick="$.operate.detailTabRewriteThree(\'' + value + '\',\''+ row.constructUnitId +'\')">'+value+'</a> ');
							}
							return actions.join('');
						}
                    },
                    {
                        field: 'totalCompany',
                        title: '施工总包单位(老数据)',
						visible: false
                    },
					{
                        field: 'totalCompanyGuid',
                        title: '施工总包单位标识符',
						visible: false
                    },
                    {
                        field: 'totalCompanyName',
                        title: '施工总包单位',
						formatter: function (value, row, index) {
							var actions = [];
							if(!$.common.isEmpty(value) && !$.common.isEmpty(row.totalCompanyGuid)){
								actions.push('<a href="javascript:void(0)" onclick="$.operate.detailTabRewriteFive(\'' + value + '\',\''+ row.totalCompanyGuid +'\')">'+value+'</a> ');
								return actions.join('');
							}
						}
                    },
                    {
                        field: 'constructionManager',
                        title: '项目经理'
                    },
                    {
	                    field: 'opera',
	                    title: '操作',
                        formatter: function (value, row, index) {
                            var actions = [];
							actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.operate.detailQYTabRewrite(\'' + row.guid + '\',\'' + row.unitEngineeringName + '变更\')"><i class="fa fa-edit"></i>查看</a> ');
                            return actions.join('');
	                       }
	                }]
        };
    	$.table.init(options);
    });
    </script>
</body>
</html>